package com.kgc.scd.service.impl;

import com.kgc.scd.entity.ShopOrder;
import com.kgc.scd.entity.ShopOrderitem;
import com.kgc.scd.mapper.ShopOrderitemMapper;
import com.kgc.scd.service.ShopOrderitemService;
import com.kgc.scd.util.RedisUtils;
import com.kgc.scd.vo.ShopOrderitemVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created On : 2022/11/17.
 * <p>
 * Author : Administrator
 * <p>
 * Description: ShopOrderitemService
 */
@Slf4j
@Service
public class ShopOrderitemServiceImpl implements ShopOrderitemService {

    @Autowired(required = false)
    private ShopOrderitemMapper shopOrderitemMapper;

    @Autowired
    private RedisUtils redisUtils;
    @Override
    public void insertShopOrderitemtosave(ShopOrderitemVO shopOrderitemVO) {

        ShopOrderitem shopOrderitem=new ShopOrderitem();
        BeanUtils.copyProperties(shopOrderitemVO,shopOrderitem);

        //存入数据库,redis
        shopOrderitemMapper.insert(shopOrderitem);
        //redisUtils.set(shopOrderitem.getUserId()+":orderitem:"+shopOrderitem.getId(),shopOrderitem);
    }
}
